//
//  LabelCell.m
//  MyTrip
//
//  Created by zhang on 15/8/27.
//  Copyright (c) 2015年 张益. All rights reserved.
//

#import "LabelCell.h"
#import "DKNightVersion.h"


@implementation LabelCell

- (void)dealloc
{
    [_label release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [DKNightVersionManager addClassToSet:self.class];
        self.nightBackgroundColor = UIColorFromRGB(0x343434);
        self.label = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 375 * OffWidth, 10 * OffHeight)] autorelease];
        _label.numberOfLines = 0;
        _label.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_label];
    }
    return self;
}

+ (CGFloat)heghtForText:(NSString *)text{
    CGRect rect = [text boundingRectWithSize:CGSizeMake(345 * OffWidth, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil];
    return rect.size.height;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
